package com.heima.user.controller.v1;


import com.heima.model.admin.dtos.AuthPassDto;
import com.heima.model.admin.dtos.PageDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author 嘉德罗斯
 * @date 2021/11/28
 */
@RequestMapping("/api/v1/auth")
@RestController
public class AuthController {

    @Autowired
    private AuthService authService;

    @PostMapping("/list")
    public ResponseResult list(@RequestBody PageDto dto){
        return authService.find(dto);
    }

    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthPassDto dto){
        return authService.authPass(dto);
    }

    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody AuthPassDto dto){
        return authService.authFail(dto);
    }
}
